#ifndef _USART5__H
#define _USART5__H
#include "stdio.h"
#include "at32f435_437.h"
#include "at32f435_437_int.h"
//#include "delay.h"
#include "string.h"
#include "Task_mpu.h"
#include "Task_GPS.h"
#include "Compass.h"
#include "gps.h"

#define UART5_GPIO_CRM_CLK          CRM_GPIOB_PERIPH_CLOCK
#define UART5_TX_PIN                GPIO_PINS_6
#define UART5_RX_PIN                GPIO_PINS_5
#define UART5_GPIO                  GPIOB


//#define UART5_TX_PIN_SOURCE         UART5_TX_PIN
//#define UART5_RX_PIN_SOURCE         UART5_RX_PIN
#define UART5_PIN_MUX_NUM        		GPIO_MUX_8
#define UART5_BUFLEN 								1024

typedef enum {
	Module_IDLE = 0,
	Module_$GPGSV,
	Module_$GBGSV,
	Module_$GNGGA,
	Module_$GNGSA,
	Module_$GNRMC,
	Module_$GNVTG,
}_GPS_Module;
extern _GPS_Module Gps_Module, Flag_GpsRxModule;
void Uart5Dma_Init(uint32_t baudrate);
void Uart5_Init(uint32_t bound);

extern u8 Uart5_RXBUF[UART5_BUFLEN];
extern const char srt_GNGGA[]; 
extern const char str_GNRMC[]; 

extern const char srt_GNGGA[];; 
extern const char str_GNRMC[];; 
extern const char str_GpsModuleEnd[];;
extern uint8_t str_GNGGA_Index,str_GNRMC_Index;
extern uint8_t str_GpsModuleEnd_Index;
extern _GPS_Module Gps_Module;
extern _GPS_Module Flag_GpsRxModule;
extern uint16_t Uart5_Index;

extern unsigned char GPS_GGA_ON[];//GGA ON
extern unsigned char GPS_SAVE[];//GPS SAVE

void Iint_GPS_Send(void);
void Uart5Send(uint8_t *buff,uint8_t size);




#endif
